<template>
  <ant-modal modalWidth="800" modalHeight="700" :visible="open" :modal-title="formTitle" :adjust-size="true" @cancel="cancel">
    <a-form-model ref="form" :model="form" :rules="rules" slot="content" layout="vertical">
      <a-row :gutter="32">
        <a-col :span="24">
          <t-x-map :height="mapHeight" v-model="form"></t-x-map>
        </a-col>
        <a-col :span="8">
          <a-form-model-item label="名称" prop="name">
            <a-input v-model="form.name" placeholder="请输入区域地图名称" />
          </a-form-model-item>
        </a-col>
        <a-col :span="8">
          <a-form-model-item label="地区" prop="regionId">
            <select-region v-model="form.regionId" :disabled="selectDisable" placeholder="请选择地区" dataType="map" />
          </a-form-model-item>
        </a-col>
        <a-col :span="4">
          <a-form-model-item label="纬度" prop="longitude">
            <a-input v-model="form.longitude" placeholder="请输入区域地图纬度" :disabled="inputDisable" />
          </a-form-model-item>
        </a-col>
        <a-col :span="4">
          <a-form-model-item label="经度" prop="latitude">
            <a-input v-model="form.latitude" placeholder="请输入区域地图经度" :disabled="inputDisable" />
          </a-form-model-item>
        </a-col>
        <a-col :span="4">
          <a-form-model-item label="范围半径" prop="range">
            <a-input-number v-model="form.range" :min="0" :max="3000000" style="width: 100%" />
          </a-form-model-item>
        </a-col>
        <a-col :span="4">
          <a-form-model-item label="缩放等级" prop="scale">
            <a-input-number v-model="form.scale" :min="3" :max="20" style="width: 100%" />
          </a-form-model-item>
        </a-col>
        <a-col :span="4">
          <a-form-model-item label="纵向偏移量" prop="longitudinalOffset">
            <a-input-number v-model="form.longitudinalOffset" :min="0" :max="1000" style="width: 100%" />
          </a-form-model-item>
        </a-col>
        <a-col :span="4">
          <a-form-model-item label="横向偏移量" prop="lateralOffset">
            <a-input-number v-model="form.lateralOffset" :min="0" :max="1000" style="width: 100%" />
          </a-form-model-item>
        </a-col>
        <a-col :span="4">
          <a-form-model-item label="文本边缘留白" prop="padding">
            <a-input-number v-model="form.padding" :min="0" :max="100" style="width: 100%" />
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
    <template slot="footer">
      <a-button :disabled="disabled" @click="cancel"> 取消 </a-button>
      <a-button type="primary" :disabled="disabled" @click="submitForm(true)"> 保存 </a-button>
    </template>
  </ant-modal>
</template>
<script>
import RegionMapAddForm from './RegionMapForm'
export default {
  ...RegionMapAddForm
}
</script>
